afc.cfg: define _AFC_GLOBAL_VARS so the BT_* helper macros work - #314
Open
kyleinoregon wants to merge 1 commit into
Open
afc.cfg: define _AFC_GLOBAL_VARS so the BT_* helper macros work#314kyleinoregon wants to merge 1 commit into
kyleinoregon wants to merge 1 commit into
Conversation
BT_CHANGE_TOOL, BT_LANE_EJECT, BT_LANE_MOVE, AFC_DISABLE_SKEW and AFC_ENABLE_SKEW all read printer['gcode_macro _AFC_GLOBAL_VARS'], which upstream AFC defines in AFC_Macro_Vars.cfg. COSMOS ships its own afc.cfg without that section, so every one of those macros fails with a template error. Define the three variables the shipped macros use, with the lane prefix set to CANVAS_. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BT_CHANGE_TOOL,BT_LANE_EJECT,BT_LANE_MOVE,AFC_DISABLE_SKEWandAFC_ENABLE_SKEWin the shippedafc.cfgall readprinter['gcode_macro _AFC_GLOBAL_VARS']. Upstream AFC defines that section inAFC_Macro_Vars.cfg, which COSMOS does not ship, so every one of those macros fails with a Jinja error the first time someone tries them.This adds the section with the three variables the shipped macros use, with the lane prefix set to
CANVAS_, soBT_CHANGE_TOOL LANE=2becomesCHANGE_TOOL LANE=CANVAS_2.A user who already defined
_AFC_GLOBAL_VARSinprinter.cfgkeeps working: Klipper merges duplicate sections and the later one wins.Tested
On a CC1 with CANVAS on 26.08.0 with this section in
printer.cfg(same content):BT_LANE_EJECT LANE=2resolves toLANE_UNLOAD LANE=CANVAS_2and runs; without the section it fails with'gcode_macro _AFC_GLOBAL_VARS'undefined.Related: the lane eject those macros call is being enabled in the AFC fork (suchmememanyskill/AFC-Klipper-Add-On#1); once that lands the AFC recipe's SRCREV can move.